Optimal. Leaf size=249 \[ -\frac {b \left (-7 a^2 C+5 a b B-3 b^2 C\right ) \sin (c+d x)}{6 d \left (a^2-b^2\right )^2 (a+b \cos (c+d x))^2}-\frac {b (b B-2 a C) \sin (c+d x)}{3 d \left (a^2-b^2\right ) (a+b \cos (c+d x))^3}-\frac {b \left (-13 a^3 C+11 a^2 b B-17 a b^2 C+4 b^3 B\right ) \sin (c+d x)}{6 d \left (a^2-b^2\right )^3 (a+b \cos (c+d x))}+\frac {\left (-2 a^4 C+2 a^3 b B-7 a^2 b^2 C+3 a b^3 B-b^4 C\right ) \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{d (a-b)^{7/2} (a+b)^{7/2}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.75, antiderivative size = 249, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, integrand size = 48, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.104, Rules used = {24, 2754, 12, 2659, 205} \[ \frac {\left (-7 a^2 b^2 C+2 a^3 b B-2 a^4 C+3 a b^3 B-b^4 C\right ) \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{d (a-b)^{7/2} (a+b)^{7/2}}-\frac {b \left (11 a^2 b B-13 a^3 C-17 a b^2 C+4 b^3 B\right ) \sin (c+d x)}{6 d \left (a^2-b^2\right )^3 (a+b \cos (c+d x))}-\frac {b \left (-7 a^2 C+5 a b B-3 b^2 C\right ) \sin (c+d x)}{6 d \left (a^2-b^2\right )^2 (a+b \cos (c+d x))^2}-\frac {b (b B-2 a C) \sin (c+d x)}{3 d \left (a^2-b^2\right ) (a+b \cos (c+d x))^3} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 24
Rule 205
Rule 2659
Rule 2754
Rubi steps
\begin {align*} \int \frac {a b B-a^2 C+b^2 B \cos (c+d x)+b^2 C \cos ^2(c+d x)}{(a+b \cos (c+d x))^5} \, dx &=\frac {\int \frac {b^2 (b B-a C)+b^3 C \cos (c+d x)}{(a+b \cos (c+d x))^4} \, dx}{b^2}\\ &=-\frac {b (b B-2 a C) \sin (c+d x)}{3 \left (a^2-b^2\right ) d (a+b \cos (c+d x))^3}-\frac {\int \frac {-3 b^2 \left (a b B-a^2 C-b^2 C\right )+2 b^3 (b B-2 a C) \cos (c+d x)}{(a+b \cos (c+d x))^3} \, dx}{3 b^2 \left (a^2-b^2\right )}\\ &=-\frac {b (b B-2 a C) \sin (c+d x)}{3 \left (a^2-b^2\right ) d (a+b \cos (c+d x))^3}-\frac {b \left (5 a b B-7 a^2 C-3 b^2 C\right ) \sin (c+d x)}{6 \left (a^2-b^2\right )^2 d (a+b \cos (c+d x))^2}+\frac {\int \frac {2 b^2 \left (3 a^2 b B+2 b^3 B-3 a^3 C-7 a b^2 C\right )-b^3 \left (5 a b B-7 a^2 C-3 b^2 C\right ) \cos (c+d x)}{(a+b \cos (c+d x))^2} \, dx}{6 b^2 \left (a^2-b^2\right )^2}\\ &=-\frac {b (b B-2 a C) \sin (c+d x)}{3 \left (a^2-b^2\right ) d (a+b \cos (c+d x))^3}-\frac {b \left (5 a b B-7 a^2 C-3 b^2 C\right ) \sin (c+d x)}{6 \left (a^2-b^2\right )^2 d (a+b \cos (c+d x))^2}-\frac {b \left (11 a^2 b B+4 b^3 B-13 a^3 C-17 a b^2 C\right ) \sin (c+d x)}{6 \left (a^2-b^2\right )^3 d (a+b \cos (c+d x))}-\frac {\int -\frac {3 b^2 \left (2 a^3 b B+3 a b^3 B-2 a^4 C-7 a^2 b^2 C-b^4 C\right )}{a+b \cos (c+d x)} \, dx}{6 b^2 \left (a^2-b^2\right )^3}\\ &=-\frac {b (b B-2 a C) \sin (c+d x)}{3 \left (a^2-b^2\right ) d (a+b \cos (c+d x))^3}-\frac {b \left (5 a b B-7 a^2 C-3 b^2 C\right ) \sin (c+d x)}{6 \left (a^2-b^2\right )^2 d (a+b \cos (c+d x))^2}-\frac {b \left (11 a^2 b B+4 b^3 B-13 a^3 C-17 a b^2 C\right ) \sin (c+d x)}{6 \left (a^2-b^2\right )^3 d (a+b \cos (c+d x))}+\frac {\left (2 a^3 b B+3 a b^3 B-2 a^4 C-7 a^2 b^2 C-b^4 C\right ) \int \frac {1}{a+b \cos (c+d x)} \, dx}{2 \left (a^2-b^2\right )^3}\\ &=-\frac {b (b B-2 a C) \sin (c+d x)}{3 \left (a^2-b^2\right ) d (a+b \cos (c+d x))^3}-\frac {b \left (5 a b B-7 a^2 C-3 b^2 C\right ) \sin (c+d x)}{6 \left (a^2-b^2\right )^2 d (a+b \cos (c+d x))^2}-\frac {b \left (11 a^2 b B+4 b^3 B-13 a^3 C-17 a b^2 C\right ) \sin (c+d x)}{6 \left (a^2-b^2\right )^3 d (a+b \cos (c+d x))}+\frac {\left (2 a^3 b B+3 a b^3 B-2 a^4 C-7 a^2 b^2 C-b^4 C\right ) \operatorname {Subst}\left (\int \frac {1}{a+b+(a-b) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{\left (a^2-b^2\right )^3 d}\\ &=\frac {\left (2 a^3 b B+3 a b^3 B-2 a^4 C-7 a^2 b^2 C-b^4 C\right ) \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{7/2} (a+b)^{7/2} d}-\frac {b (b B-2 a C) \sin (c+d x)}{3 \left (a^2-b^2\right ) d (a+b \cos (c+d x))^3}-\frac {b \left (5 a b B-7 a^2 C-3 b^2 C\right ) \sin (c+d x)}{6 \left (a^2-b^2\right )^2 d (a+b \cos (c+d x))^2}-\frac {b \left (11 a^2 b B+4 b^3 B-13 a^3 C-17 a b^2 C\right ) \sin (c+d x)}{6 \left (a^2-b^2\right )^3 d (a+b \cos (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 1.08, size = 246, normalized size = 0.99 \[ \frac {\frac {24 \left (2 a^4 C-2 a^3 b B+7 a^2 b^2 C-3 a b^3 B+b^4 C\right ) \tanh ^{-1}\left (\frac {(a-b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {b^2-a^2}}\right )}{\sqrt {b^2-a^2}}-\frac {2 b \sin (c+d x) \left (-48 a^5 C+36 a^4 b B-23 a^3 b^2 C+a^2 b^3 B+b^2 \left (-13 a^3 C+11 a^2 b B-17 a b^2 C+4 b^3 B\right ) \cos (2 (c+d x))+6 b \left (-11 a^4 C+9 a^3 b B-10 a^2 b^2 C+a b^3 B+b^4 C\right ) \cos (c+d x)-19 a b^4 C+8 b^5 B\right )}{(a+b \cos (c+d x))^3}}{24 d \left (a^2-b^2\right )^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 1.15, size = 1305, normalized size = 5.24 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.37, size = 711, normalized size = 2.86 \[ -\frac {\frac {3 \, {\left (2 \, C a^{4} - 2 \, B a^{3} b + 7 \, C a^{2} b^{2} - 3 \, B a b^{3} + C b^{4}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a - 2 \, b\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {a^{2} - b^{2}}}\right )\right )}}{{\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )} \sqrt {a^{2} - b^{2}}} - \frac {24 \, C a^{5} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 18 \, B a^{4} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 33 \, C a^{4} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 27 \, B a^{3} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 18 \, C a^{3} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 \, B a^{2} b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 30 \, C a^{2} b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, B a b^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 18 \, C a b^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 \, B b^{6} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, C b^{6} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 48 \, C a^{5} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 36 \, B a^{4} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 16 \, C a^{3} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 32 \, B a^{2} b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 32 \, C a b^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 4 \, B b^{6} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 24 \, C a^{5} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 18 \, B a^{4} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 33 \, C a^{4} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 27 \, B a^{3} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 18 \, C a^{3} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 6 \, B a^{2} b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 30 \, C a^{2} b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, B a b^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 18 \, C a b^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 6 \, B b^{6} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, C b^{6} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )} {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a + b\right )}^{3}}}{3 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.15, size = 1817, normalized size = 7.30 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.41, size = 462, normalized size = 1.86 \[ -\frac {\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (2\,B\,b^4+C\,b^4+6\,B\,a^2\,b^2+5\,C\,a^2\,b^2-3\,B\,a\,b^3-8\,C\,a\,b^3-8\,C\,a^3\,b\right )}{\left (a+b\right )\,\left (a^3-3\,a^2\,b+3\,a\,b^2-b^3\right )}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (C\,b^4-2\,B\,b^4-6\,B\,a^2\,b^2+5\,C\,a^2\,b^2-3\,B\,a\,b^3+8\,C\,a\,b^3+8\,C\,a^3\,b\right )}{{\left (a+b\right )}^3\,\left (a-b\right )}+\frac {4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (-12\,C\,a^3\,b+9\,B\,a^2\,b^2-8\,C\,a\,b^3+B\,b^4\right )}{3\,{\left (a+b\right )}^2\,\left (a^2-2\,a\,b+b^2\right )}}{d\,\left (3\,a\,b^2-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (-3\,a^3+3\,a^2\,b+3\,a\,b^2-3\,b^3\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (-3\,a^3-3\,a^2\,b+3\,a\,b^2+3\,b^3\right )+3\,a^2\,b+a^3+b^3+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (a^3-3\,a^2\,b+3\,a\,b^2-b^3\right )\right )}-\frac {\mathrm {atan}\left (\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (2\,a-2\,b\right )\,\left (a^3-3\,a^2\,b+3\,a\,b^2-b^3\right )}{2\,\sqrt {a+b}\,{\left (a-b\right )}^{7/2}}\right )\,\left (2\,C\,a^4-2\,B\,a^3\,b+7\,C\,a^2\,b^2-3\,B\,a\,b^3+C\,b^4\right )}{d\,{\left (a+b\right )}^{7/2}\,{\left (a-b\right )}^{7/2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________